package io.kiki.stack.netty.command;

import io.kiki.stack.netty.config.switches.ProtocolSwitch;
import io.kiki.stack.netty.exception.DeserializationException;
import io.kiki.stack.netty.exception.SerializationException;
import io.kiki.stack.netty.invoker.RequestContext;

import java.io.Serializable;


public interface Command extends Serializable {

    CommandCode getCommandCode();

    int getId();

    RequestContext getRequestContext();


    ProtocolSwitch getProtocolSwitch();


    void serialize() throws SerializationException;


    void deserialize() throws DeserializationException;


    void serializeContent(RequestContext requestContext) throws SerializationException;


    void deserializeContent(RequestContext requestContext) throws DeserializationException;
}
